﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using TarreOA.TarreOABLL;
using TarreOA.TarreOAModels;

public partial class admin_Flow_BackManage_UpdateFlowStep : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.RangeValidator1.MaximumValue = Int32.MaxValue.ToString();
            Flow_NewFlowStep nfs = Flow_NewFlowStep_Service.FindFlowStepById(Convert.ToInt32(Request.QueryString["fid"]));
            txtSort_Id.Text = nfs.Sort_id.ToString();
            txtPrc_Name.Text = nfs.Prc_name;
            txtNext_Prcs.Text = nfs.NextPrc_id;
        }
    }
    protected void btnBack_Click(object sender, EventArgs e)
    {
        Response.Redirect("FlowStepList.aspx?id=" + Request.QueryString["id"]+"&pageIndex="+Request.QueryString["pageIndex"]);
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        Flow_NewFlowStep nfs = new Flow_NewFlowStep();
        nfs.NewFlowStep_id = Convert.ToInt32(Request.QueryString["fid"]);
        nfs.NextPrc_id = txtNext_Prcs.Text;
        nfs.Prc_name = txtPrc_Name.Text;
        nfs.Sort_id = Convert.ToInt32(txtSort_Id.Text);
        if (Flow_NewFlowStep_Service.UpdateFlowStepInfo(nfs))
        {
            Response.Redirect("FlowStepList.aspx?id=" + Request.QueryString["id"] + "&pageIndex=" + Request.QueryString["pageIndex"]);
        }
        else
        {
            ClientScript.RegisterStartupScript(this.GetType(),"","alert('修改失败！请重试！')",true);
        }
    }
}
